home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 2004 #6
/
Amiga Plus CD - 2004 - No. 06.iso
/
AmiSoft
/
Comm
/
mail
/
iSpell_YamEdit.lha
/
iSpell_YamEdit
/
iSpell_YamEdit.rx
< prev
Wrap
Text File
|
2004-04-12
|
2KB
|
80 lines
/*
$VER: iSpell_YamEdit 0.5.0
*/
BINPATH = "iSpell:bin/"
aword=ARG(1)
OPTIONS RESULTS
IF ~ OPEN('envvar', 'ENV:ISPELLYAM', 'R') THEN EXIT
language=READLN('envvar')
CLOSE('envvar')
IF ~ SHOW('P', 'IRexxSpell') THEN
DO
PRAGMA('S',16384)
ADDRESS COMMAND
'run <nil: >nil: 'BINPATH'iSpell -d'language' -r >nil: <nil:'
'waitforport IRexxSpell'
END
ADDRESS 'IRexxSpell'
IF VERIFY(SUBSTR(aword,2),'ABCDEFGHIJKLMNOPQRSTUVWXYZ','M')=0
THEN
'QUICKCHECK 'aword''
ELSE
'QUICKCHECK 'TRANSLATE(aword,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')''
IF result='ok' THEN EXIT
'CHECK 'aword''
r=result
r1=SUBSTR(r,1,1)
r3=SUBSTR(r,3)
IF r1='&' & WORDS(r3)>1 THEN
DO
rwords=SUBSTR(r3,POS(':',r3)+2)
x=0; choose=''
DO UNTIL rwords=''
x=x+1
posi=POS(',',rwords)
IF posi~=0 THEN
DO
temp.x=LEFT(rwords,posi-1)
choose=choose||temp.x'|'
rwords=SUBSTR(rwords,posi+2)
END
ELSE
DO
temp.x=rwords
choose=choose||temp.x
rwords='';nums=x
END
END
ADDRESS YAM 'REQUEST "Choose a replacement for 'aword' or an [option]" "'choose'|[Acc|Add|Can]"'
IF result=nums+1 THEN SIGNAL accept
IF result=nums+2 THEN SIGNAL addis
IF result~=0 THEN
DO
DO x=1 TO nums
IF result=x THEN nword=temp.x
END
SIGNAL ReplaceWord
END
END
IF r1='#' THEN ADDRESS YAM 'REQUEST "Could not find anything for 'aword' Please Choose an option:" "Accept|Add..|Cancel"'
IF result=1 THEN SIGNAL accept
IF result=2 THEN SIGNAL addis
EXIT
ReplaceWord:
ADDRESS YAM
MAILWRITE WINDOW 0
'WRITEEDITOR "'CURSOR left'"'
DO count=1 TO LENGTH(aword)
'WRITEEDITOR "'BACKSPACE'"'
END
'WRITEEDITOR "'TEXT nword'"'
'WRITEEDITOR "'CURSOR right'"'
EXIT
addis:
ADDRESS YAM 'REQUEST "Add the word: 'aword' to iSpell user Dict.?" "_Yes|_No"'
IF result=1 THEN ADDRESS 'IRexxSpell' 'ADD 'aword
EXIT
accept:
ADDRESS 'IRexxSpell' 'ACCEPT 'aword
EXIT